/* @file singletonapp.h
 * \brief Definizione dell'interfaccia singleton per le risorse applicative.
 * @date Mar 5, 2012
 * @author Francesco Corvino
 */

#ifndef SINGLETONAPP_H_
#define SINGLETONAPP_H_

#include "../chandl/cinvocator.h"

typedef struct descSingApp {
	DescApplication resource;
	pthread_mutex_t contrSing;
} SingletonApp;

typedef int (*SingApp_OperationCunc)(DescApplication*);

void SingleApp_initialize(DescApplication * initvalue);

int SingApp_CMDSelector(const void * a, const void * b);

int SingApp_ReqSelectorByNameCMD(const void * a, const void * b);

int SingleApp_getResource(SingApp_OperationCunc operation);

#endif /* SINGLETONAPP_H_ */
